package br.com.marsso.sorte.client.ui;

import br.com.marsso.sorte.shared.SorteRequestFactory;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.VerticalPanel;

public class Menu extends Content {
	private SorteRequestFactory requestFactory;
	

	public Menu(SorteRequestFactory requests) {
		this.requestFactory = requests;
		
		VerticalPanel verticalPanel = new VerticalPanel();
		initWidget(verticalPanel);

		Grid grid = new Grid(1, 3);
		verticalPanel.add(grid);

		Button btnModalidade = new Button("Modalidade");

		grid.setWidget(0, 0, btnModalidade);

		Button btnSorteios = new Button("Sorteios");
		grid.setWidget(0, 1, btnSorteios);

		Button btnApostas = new Button("Apostas");
		grid.setWidget(0, 2, btnApostas);

		btnModalidade.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				ContentContainer.setRoot("content");
				ContentContainer.setContent(new ModalidadeForm(requestFactory));

			}
		});

	}

}
